package cc.lucien.io;

import java.io.*;

public class CopyDemo {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = new FileInputStream("F:/tmp/test.txt");
        byte[] bytes = new byte[1024 * 10];
        inputStream.read(bytes);
        System.out.println(new String(bytes));
        inputStream.close();

        OutputStream outputStream = new FileOutputStream("F:/tmp/test2.txt");
        BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(outputStream);
        bufferedOutputStream.write("测试写文件".getBytes());
        bufferedOutputStream.flush();
        bufferedOutputStream.close();
        outputStream.close();
    }
}
